package operation;

import Beans.Student;
import User.User;
import Utils.MenuInputUtil;
import Utils.SQLSentencePoll;
import dao.DataOperation;

/**
 * 同ModifyPersonalInfo功能，但显示不同的交互信息
 */
public class ModifyStudentInfo implements IOperation{
    @Override
    public boolean operate(User user) {
        System.out.println("修改学生信息~");
        //查找指定id学生
        System.out.println("请输入您要修改的学生id（13位整数）：");
        String id = MenuInputUtil.readString(13);
        Student student = DataOperation.queryOne(Student.class, SQLSentencePoll.SpecifiedAccount_Check, id);
        if(student != null){
            //账户信息变更
            ModifyPersonalInfo modifyPersonalInfo = new ModifyPersonalInfo();
            modifyPersonalInfo.subModify(student.getId(),user);
        }else{
            System.out.println("未查询到该学生！无法修改");
        }

        return true;
    }
}
